Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix items with different mods getting stacked together #52252

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Oct 12, 2021

Summary

None

Purpose of change

Fixes #52251.

Describe the solution

Check item mods when comparing two items. This prevents items with different mods from being stacked together if they are otherwise identical. This fix applies to all item screens that use item::stacks_with().

aim_stack
pickup_stack

Describe alternatives you've considered

Testing

  1. Spawn 3-4 M4s
  2. Unload all the magazines
  3. Add different mods to a few of them
  4. Drop them all on the same tile
  5. Examine the items with g or through AIM
  6. M4s with mods are separated accordingly

Additional context

@Maleclypse Maleclypse added <Bugfix> This is a fix for a bug (or closes open issue) Items / Item Actions / Item Qualities Items and how they work and interact Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons labels Oct 12, 2021
@PatrikLundell
Copy link
Contributor

There are some dissimilar items that do stack and presumably are intended to stack, such as survivor notes. It would probably be good to check that they still stack even if they have different texts on them.

@dseguin
Copy link
Member Author

dseguin commented Oct 12, 2021

Nothing in the code suggests that would be the case, and a sanity check shows that items without mods (+1, +2, etc.) still stack normally:
note_stack

@kevingranade kevingranade merged commit 95019f2 into CleverRaven:master Oct 13, 2021
@dseguin dseguin deleted the fix_itemstack branch November 7, 2021 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Guns with gunmods get stacked with Guns without any gunmods
4 participants